class graph{

  Float nm[] = new Float[240];
  Float hx[] = new Float[240];
  graph(){
    nm[0] = 0.0;
  }
 void paint(Float pulse[], int sample, int window, int x){
   float dc = 0;
   float rc = 0;
   float pmax = 0;
   float pmin = 0;
   float average = 0;
   for(int z = 1; z<sample; z++){
     
   }
   for(int iterator = 1; iterator < (sample-7); iterator++){
    //High pass filter 
   
    nm[0]=0.0;
    hx[0]=0.0;
    if(pulse[iterator]==0.0){
     // nm[iterator]=256.0;
     // hx[iterator]=256.0;
    }
    else{
   
    if(write == 0){
    output.println(pulse[iterator]);  
    }
   //rect(iterator*3,300-(nm[iterator]*(1000^20000)),3,(nm[iterator]*(1000^20000)));  
  dc = rc;
  rc=pulse[iterator]-((pulse[iterator]+pulse[iterator+1]+pulse[iterator+2]+pulse[iterator+3]+pulse[iterator+5]+pulse[iterator+6])/7);
  if(rc>pmax){
    pmax = rc;
  }
  else{
  }
  if(rc<pmin){
    pmin = rc;
  }
  else{
  }
  stroke(0,250,0);
  strokeWeight(3);
  line((iterator-1)*3,500-(dc*10),iterator*3,500-(rc*10));
  //stroke(0,250,0);
  //line((iterator-1)*3,800-(dc*100),iterator*3,800-(rc*100));
  //line((iterator-1)*3,600-(hx[iterator-1]*10),iterator*3,600-(hx[iterator]*10));
}  
    
   }
   write=1;
   output.close();
 }
}

